package com.ruoyi.mall.sms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.sms.mapper.SmsFlashPromotionMapper;
import com.ruoyi.mall.sms.domain.SmsFlashPromotion;
import com.ruoyi.mall.sms.service.ISmsFlashPromotionService;

/**
 * 限时购Service业务层处理
 * 
 * @author xuxing
 * @date 2021-02-09
 */
@Service
public class SmsFlashPromotionServiceImpl implements ISmsFlashPromotionService 
{
    @Autowired
    private SmsFlashPromotionMapper smsFlashPromotionMapper;

    /**
     * 查询限时购
     * 
     * @param id 限时购ID
     * @return 限时购
     */
    @Override
    public SmsFlashPromotion selectSmsFlashPromotionById(Long id)
    {
        return smsFlashPromotionMapper.selectSmsFlashPromotionById(id);
    }

    /**
     * 查询限时购列表
     * 
     * @param smsFlashPromotion 限时购
     * @return 限时购
     */
    @Override
    public List<SmsFlashPromotion> selectSmsFlashPromotionList(SmsFlashPromotion smsFlashPromotion)
    {
        return smsFlashPromotionMapper.selectSmsFlashPromotionList(smsFlashPromotion);
    }

    /**
     * 新增限时购
     * 
     * @param smsFlashPromotion 限时购
     * @return 结果
     */
    @Override
    public int insertSmsFlashPromotion(SmsFlashPromotion smsFlashPromotion)
    {
        smsFlashPromotion.setCreateTime(DateUtils.getNowDate());
        return smsFlashPromotionMapper.insertSmsFlashPromotion(smsFlashPromotion);
    }

    /**
     * 修改限时购
     * 
     * @param smsFlashPromotion 限时购
     * @return 结果
     */
    @Override
    public int updateSmsFlashPromotion(SmsFlashPromotion smsFlashPromotion)
    {
        return smsFlashPromotionMapper.updateSmsFlashPromotion(smsFlashPromotion);
    }

    /**
     * 批量删除限时购
     * 
     * @param ids 需要删除的限时购ID
     * @return 结果
     */
    @Override
    public int deleteSmsFlashPromotionByIds(Long[] ids)
    {
        return smsFlashPromotionMapper.deleteSmsFlashPromotionByIds(ids);
    }

    /**
     * 删除限时购信息
     * 
     * @param id 限时购ID
     * @return 结果
     */
    @Override
    public int deleteSmsFlashPromotionById(Long id)
    {
        return smsFlashPromotionMapper.deleteSmsFlashPromotionById(id);
    }
}
